<template>
  <div class="noticeList">
    <div class="title">
      <navTitle :navArr="navArr"></navTitle>
    </div>
    <noCont v-if="isEmpty"></noCont>
    <div class="tables" v-if="!isEmpty">
      <el-table @row-click="lookDetail" :data="chargeList" style="width: 100%">
        <el-table-column prop="title" label="标题" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="summary" label="摘要" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="publishTime" label="发布时间" align="center">
        </el-table-column>
        <el-table-column prop="noticeTypeDetail" label="公告类型" align="center">
        </el-table-column>
      </el-table>
      <div class="pager">
        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="pageSizeArray" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="pageTotal">
        </el-pagination>
      </div>
    </div>
  </div>
</template>
<script type="text/ecmascript-6">
import NavTitle from '../../base/navTitle/index'
import { pageCommon } from '../../../assets/js/mixin.js'
import { mapGetters } from 'vuex'
import NoCont from '../../base/noCont/index'
export default {
  name: 'noticeList',
  mixins: [pageCommon],
  components: {
    NavTitle,
    NoCont
  },
  data () {
    return {
      navArr: ['公告'],
      apiUrl: '/api/notice/getNoticeListBySubstationId',
      chargeList: []
    }
  },
  computed: {
    params () {
      return {
        substationId: this.sellerInfo.substationId,
        pageNo: this.pageNo,
        pageSize: this.pageSize
      }
    },
    ...mapGetters([
      'sellerInfo'
    ])
  },
  methods: {
    lookDetail (row) {
      this.$router.push({ name: 'noticeDetail', query: { noticeId: row.noticeId } })
    },
    setList (data) {
      this.chargeList = data
    }
  }
}
</script>
<style lang="stylus" rel="stylesheet/stylus" scoped>
.noticeList
  .tables
    margin-top 24px
</style>
